﻿<data:DataGrid
    x:Class="ZipSpace.ZipDataGrid"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
    xmlns:data2="clr-namespace:System.Windows.Data;assembly=System.Windows"
    xmlns:cm="clr-namespace:System.ComponentModel;assembly=System.Windows"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400"
    AutoGenerateColumns="False" IsReadOnly="True">

  <data:DataGrid.Resources>
    <data2:CollectionViewSource x:Key="source" Source="{Binding}">
      <data2:CollectionViewSource.SortDescriptions>
        <cm:SortDescription PropertyName="CompressedSize" Direction="Descending" />
      </data2:CollectionViewSource.SortDescriptions>
    </data2:CollectionViewSource>
  </data:DataGrid.Resources>

  <data:DataGrid.Columns>
    <data:DataGridTextColumn Binding="{Binding Mode=OneWay, Path=Name}" Header="Name" x:Name="NameColumn" />
    <data:DataGridTextColumn Binding="{Binding Mode=OneWay, Path=Extension}" Header="Type" />
    <data:DataGridTextColumn Binding="{Binding Mode=OneWay, Path=SizeFormatted}" SortMemberPath="Size" Header="Size" />
    <data:DataGridTextColumn Binding="{Binding Mode=OneWay, Path=CompressedSizeFormatted}" SortMemberPath="CompressedSize" Header="Compressed Size" />
    <data:DataGridTextColumn Binding="{Binding Mode=OneWay, Path=CompressionRatioFormatted}" SortMemberPath="CompressionRatio" Header="Compression Ratio" />
  </data:DataGrid.Columns>
  
</data:DataGrid>
